package com.hfzy.ihk.facade.ivr.vo;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by Administrator on 2016/4/26.
 * 呼叫任务：发起呼叫时产生
 *
 *
 * 云呼版本  1.0  ，置业默认：mainCallPhone:客户号码。targetCallPhone：经纪号码
 * 云呼版本  2.0  ，置业默认：mainCallPhone:经纪号码。targetCallPhone：客户号码
 *
 */
public class CallHistory extends CallRecordBaseEntity implements Serializable{

    private static final long serialVersionUID = 1L;


    /**
     * 创建时间
     */
    private Date createTime = new Date();

    /**
     * 创建人
     * */
    private String createUserId = "-1";

    /**
     * 创建人
     * */
    private String createUserNo = "-1";

    /**
     * 修改时间
     */
    private Date modTime = new Date();

    /**
     * 修改人
     * */
    private Integer modUserId = -1;

    private String remark = "";

    private String sessionId = null; //会话ID

    private Long version;
    /**
     * E1,阿里云：客户号码
     * 手机云呼： 经纪号码
     * */
    private String mainCallPhone = null; //主叫；由拨号时发送过来
    /**
     *
     * */
    private String targetCallPhone = null; //被叫；由拨号时发送过来

    private String showNum = null; //主显号码：小号、E1固话等；

    private String dataId = "-1"; //置业或app数据库 数据id，用于jms推送数据时，置业或app更新数据的索引；这要求置业或app保存数据成功后再提交呼叫任务到云呼
    private Integer whereFrom = -1; //来源：app(0),置业(1)，洗号(2)，洗主显(3)，job(99999,主要用于批量插入，定时检测是否达到时间阀值),crm(5)
    private Integer pageFrom = -1; //app盘源(0),app联动call(1),置业盘源(2)，置业联动call(3),电子客簿（4），测试座机页面（5）,app 拨号记录(6)
    private String machineFrom = null;//机器码：用于定位websocket对象（websocket）；app的话，传userId
    private Integer mainCallType = -1; //mainCallPhone是什么号码？经纪人：1， 客户：0
    private String customerName = null; //客户名字

    private String propertyNo  = null;    //房源编号或客户编号（使用来源页面pageFrom区分）
    private String project  = null;       //项目名或客户最新根据（使用来源页面pageFrom区分）
    private String objectId  = null;       ////置业oracle通话记录中，盘源、客户、项目的id（联动call）

    private Integer commitTo = -1; //提交到哪里：东进(0)/电信(1)，手机（2）(在线),手机离线(3),阿里云（9）,freeswitch(8)
    private Boolean commitOk = false; //提交呼叫任务到CTI/福建电信 成功
    private Date commitTime; //提交呼叫任务到 CTI/福建电信时间

    private Integer city = -1;  //经纪所在城市:广州(1)/东莞(2)/佛山(3)

    private Integer callType = -1; //通话类型：呼出(0)、呼入(1),呼出《经纪人呼主显转接到客户》(2)

    private String ims = null; //计费号码，记录使用哪个计费号码呼出

    private String recordFileUrl = null; //录音文件地址
    private Long recordTimeLength = -1L; //通话时长（S）

    private String recordFileUrlPartA = null; //语音分析录音文件地址

    private Integer interrupt=-1; //是否中断    未中断（-1），自动动中断（0），手段中断（1）
    private Date interruptTime; //中断时间

    private String callOutResultMessage; // 呼出调用api返回的消息中文

    private String callOutResultCode; // 呼出调用api返回的消息code

    private String callOutrequestId; //呼出请求的id
    //=================呼叫状态================
    private Boolean mainCallRinging; //主叫响铃
    private Date mainCallRingingTime; //主叫响铃时间
    private Date receiveMainCallRingingTime; //接收主叫响铃状态时间
    private Boolean mainCallAnswered; //主叫应答
    private Date mainCallAnsweredTime; //主叫应答
    private Date receiveMainCallAnsweredTime; //接收主叫应答状态时间
    private Boolean mainCallFailed; //呼叫主叫失败：如果没有响铃，表示主叫空号；如有响铃，表示未接听或把来电号码加入黑名单或手机飞行模式（电信）
    private Date mainCallFailedTime; //呼叫主叫失败时间
    private Date receiveMainCallFailedTime; //接收呼叫主叫失败状态时间
    private Boolean targetCallRinging; //被叫响铃
    private Date targetCallRingingTime; //被叫响铃时间
    private Date receiveTargetCallRingingTime; //接收被叫响铃状态时间
    private Boolean targetCallAnswered; //被叫应答
    private Date targetCallAnsweredTime; //被叫应答
    private Date receiveTargetCallAnsweredTime; //接收被叫应答状态时间
    private Boolean targetCallFailed; //呼叫被叫失败：如果没有响铃，表示被叫空号；如有响铃，表示未接听或把来电号码加入黑名单或手机飞行模式；（电信）
    private Date targetCallFailedTime; //呼叫被叫失败时间
    private Date receiveTargetCallFailedTime; //接收呼叫被叫失败状态时间


    private Date disconnectTime; //通话结束时间（也包含使用手机拨打的结束时间）
    private Date receiveDisconnectTime; //接收通话结束时间状态时间
    private String failedReason = null; //不能正常通话原因

    private String messageId = null; //jms msg Id  阿里云 callId
    private String jsonpCallBack = null; //用于jsonP 的callBack名，不需记录到数据库
    private Boolean isInserted = false; //这里用来判断是否已经入推了ES队列，不管是推送成功还是失败都表示为 true
    private String today = null;



    private Integer dealStatus; //是否已经转到HBase标识 空或者0 --未转移，1-已经成功转移，-1转了但是没找到文件(可能为空，可能按规则找不到)，-3（掉了转移接口但是没成功存到hbase）， 2--成功删除了对应的wav文件，-2--执行了删除文件但是job没找到wav

    private String hbaseRecordFileUrl; //hbase录音文件链接

    private String hbaseRecordFileUrlA;//hbase录音文件链接头文件



    private Date mainCallStartTime;  //阿里录音话单，主叫开始时间

    private Date mainCallEndTime;   //阿里录音话单，主叫结束时间

    private Integer mainCallLength;   //阿里录音话单，主叫通话时长（s）

    private Date targetCallStartTime;  //阿里录音话单，被叫开始时间

    private Date targetCallEndTime;   //阿里录音话单，被叫结束时间

    private Integer targetCallLength;   //阿里录音话单，被叫通话时长（s）


    private String callTaskId;

    private String packageId;

    private String packageName;

    //asr外呼部分
    //播放的录音文件
    private String voiceCode;

    private String voiceText;

    private Boolean actionCodeBreak;

    //暂时不保存此标志
    private Boolean needAsr;
    //fs添加

    private String ccid;

    private String sipUser;

    //是否需要切用e1 当线路不足的时候
    private Boolean noEnoughChannel =false ;

    private String company;

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public Boolean getNoEnoughChannel() {
        return noEnoughChannel;
    }

    public void setNoEnoughChannel(Boolean noEnoughChannel) {
        this.noEnoughChannel = noEnoughChannel;
    }

    public String getCcid() {
        return ccid;
    }

    public void setCcid(String ccid) {
        this.ccid = ccid;
    }

    public String getSipUser() {
        return sipUser;
    }

    public void setSipUser(String sipUser) {
        this.sipUser = sipUser;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getDataId() {
        return dataId;
    }

    public void setDataId(String dataId) {
        this.dataId = dataId;
    }

    public String getVoiceText() {
        return voiceText;
    }

    public void setVoiceText(String voiceText) {
        this.voiceText = voiceText;
    }

    public String getVoiceCode() {
        return voiceCode;
    }

    public void setVoiceCode(String voiceCode) {
        this.voiceCode = voiceCode;
    }

    public Boolean getActionCodeBreak() {
        return actionCodeBreak;
    }

    public void setActionCodeBreak(Boolean actionCodeBreak) {
        this.actionCodeBreak = actionCodeBreak;
    }

    public String getPackageId() {
        return packageId;
    }

    public void setPackageId(String packageId) {
        this.packageId = packageId;
    }

    public Date getMainCallStartTime() {
        return mainCallStartTime;
    }

    public void setMainCallStartTime(Date mainCallStartTime) {
        this.mainCallStartTime = mainCallStartTime;
    }

    public Date getMainCallEndTime() {
        return mainCallEndTime;
    }

    public void setMainCallEndTime(Date mainCallEndTime) {
        this.mainCallEndTime = mainCallEndTime;
    }

    public Integer getMainCallLength() {
        return mainCallLength;
    }

    public void setMainCallLength(Integer mainCallLength) {
        this.mainCallLength = mainCallLength;
    }

    public Date getTargetCallStartTime() {
        return targetCallStartTime;
    }

    public void setTargetCallStartTime(Date targetCallStartTime) {
        this.targetCallStartTime = targetCallStartTime;
    }

    public Date getTargetCallEndTime() {
        return targetCallEndTime;
    }

    public void setTargetCallEndTime(Date targetCallEndTime) {
        this.targetCallEndTime = targetCallEndTime;
    }

    public Integer getTargetCallLength() {
        return targetCallLength;
    }

    public void setTargetCallLength(Integer targetCallLength) {
        this.targetCallLength = targetCallLength;
    }



    public String getObjectId() {
        return objectId;
    }

    public void setObjectId(String objectId) {
        this.objectId = objectId;
    }

    public String getHbaseRecordFileUrl() {
        return hbaseRecordFileUrl;
    }

    public void setHbaseRecordFileUrl(String hbaseRecordFileUrl) {
        this.hbaseRecordFileUrl = hbaseRecordFileUrl;
    }

    public String getHbaseRecordFileUrlA() {
        return hbaseRecordFileUrlA;
    }

    public void setHbaseRecordFileUrlA(String hbaseRecordFileUrlA) {
        this.hbaseRecordFileUrlA = hbaseRecordFileUrlA;
    }


    public Integer getDealStatus() {
        return dealStatus;
    }

    public void setDealStatus(Integer dealStatus) {
        this.dealStatus = dealStatus;
    }

    public String getToday() {
        return today;
    }

    public void setToday(String today) {
        this.today = today;
    }


    public String getIms() {
        return ims;
    }

    public void setIms(String ims) {
        this.ims = ims;
    }

    public void setMainCallPhone(String mainCallPhone) {
        this.mainCallPhone = mainCallPhone;
    }

    public void setTargetCallPhone(String targetCallPhone) {
        this.targetCallPhone = targetCallPhone;
    }

    public void setShowNum(String showNum) {
        this.showNum = showNum;
    }



    public void setWhereFrom(Integer whereFrom) {
        this.whereFrom = whereFrom;
    }

    public void setPageFrom(Integer pageFrom) {
        this.pageFrom = pageFrom;
    }

    public void setMachineFrom(String machineFrom) {
        this.machineFrom = machineFrom;
    }

    public void setMainCallType(Integer mainCallType) {
        this.mainCallType = mainCallType;
    }

    public void setCommitTo(Integer commitTo) {
        this.commitTo = commitTo;
    }

    public void setCommitOk(Boolean commitOk) {
        this.commitOk = commitOk;
    }

    public void setCity(Integer city) {
        this.city = city;
    }

    public void setCallType(Integer callType) {
        this.callType = callType;
    }

    public void setRecordFileUrl(String recordFileUrl) {
        this.recordFileUrl = recordFileUrl;
    }

    public void setRecordTimeLength(Long recordTimeLength) {
        this.recordTimeLength = recordTimeLength;
    }

    public void setRecordFileUrlPartA(String recordFileUrlPartA) {
        this.recordFileUrlPartA = recordFileUrlPartA;
    }



    public void setMainCallRinging(Boolean mainCallRinging) {
        this.mainCallRinging = mainCallRinging;
    }

    public void setMainCallRingingTime(Date mainCallRingingTime) {
        this.mainCallRingingTime = mainCallRingingTime;
    }

    public void setMainCallAnswered(Boolean mainCallAnswered) {
        this.mainCallAnswered = mainCallAnswered;
    }

    public void setMainCallAnsweredTime(Date mainCallAnsweredTime) {
        this.mainCallAnsweredTime = mainCallAnsweredTime;
    }

    public void setMainCallFailed(Boolean mainCallFailed) {
        this.mainCallFailed = mainCallFailed;
    }

    public void setMainCallFailedTime(Date mainCallFailedTime) {
        this.mainCallFailedTime = mainCallFailedTime;
    }

    public void setTargetCallRinging(Boolean targetCallRinging) {
        this.targetCallRinging = targetCallRinging;
    }


    public void setTargetCallRingingTime(Date targetCallRingingTime) {
        this.targetCallRingingTime = targetCallRingingTime;
    }

    public void setTargetCallAnswered(Boolean targetCallAnswered) {
        this.targetCallAnswered = targetCallAnswered;
    }

    public void setTargetCallAnsweredTime(Date targetCallAnsweredTime) {
        this.targetCallAnsweredTime = targetCallAnsweredTime;
    }

    public String getPropertyNo() {
        return propertyNo;
    }

    public void setPropertyNo(String propertyNo) {
        this.propertyNo = propertyNo;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public void setTargetCallFailed(Boolean targetCallFailed) {
        this.targetCallFailed = targetCallFailed;
    }

    public void setTargetCallFailedTime(Date targetCallFailedTime) {
        this.targetCallFailedTime = targetCallFailedTime;
    }

    public void setDisconnectTime(Date disconnectTime) {
        this.disconnectTime = disconnectTime;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getMainCallPhone() {
        return mainCallPhone;
    }

    public String getTargetCallPhone() {
        return targetCallPhone;
    }

    public String getShowNum() {
        return showNum;
    }



    public Integer getWhereFrom() {
        return whereFrom;
    }

    public Integer getPageFrom() {
        return pageFrom;
    }

    public String getMachineFrom() {
        return machineFrom;
    }

    public Integer getMainCallType() {
        return mainCallType;
    }

    public Integer getCommitTo() {
        return commitTo;
    }

    public Boolean getCommitOk() {
        return commitOk;
    }

    public Integer getCity() {
        return city;
    }

    public Integer getCallType() {
        return callType;
    }

    public String getRecordFileUrl() {
        return recordFileUrl;
    }

    public Long getRecordTimeLength() {
        return recordTimeLength;
    }

    public String getRecordFileUrlPartA() {
        return recordFileUrlPartA;
    }



    public Boolean getMainCallRinging() {
        return mainCallRinging;
    }

    public Date getMainCallRingingTime() {
        return mainCallRingingTime;
    }

    public Boolean getMainCallAnswered() {
        return mainCallAnswered;
    }

    public Date getMainCallAnsweredTime() {
        return mainCallAnsweredTime;
    }

    public Boolean getMainCallFailed() {
        return mainCallFailed;
    }

    public Date getMainCallFailedTime() {
        return mainCallFailedTime;
    }

    public Boolean getTargetCallRinging() {
        return targetCallRinging;
    }

    public Date getTargetCallRingingTime() {
        return targetCallRingingTime;
    }

    public Boolean getTargetCallAnswered() {
        return targetCallAnswered;
    }

    public Date getTargetCallAnsweredTime() {
        return targetCallAnsweredTime;
    }

    public Boolean getTargetCallFailed() {
        return targetCallFailed;
    }

    public Date getTargetCallFailedTime() {
        return targetCallFailedTime;
    }

    public Date getDisconnectTime() {
        return disconnectTime;
    }

    public String getMessageId() {
        return messageId;
    }

    public String getJsonpCallBack() {
        return jsonpCallBack;
    }

    public String getFailedReason() {
        return failedReason;
    }

    public void setFailedReason(String failedReason) {
        this.failedReason = failedReason;
    }

    public void setJsonpCallBack(String jsonpCallBack) {
        this.jsonpCallBack = jsonpCallBack;
    }


    public Date getCommitTime() {
        return commitTime;
    }

    public void setCommitTime(Date commitTime) {
        this.commitTime = commitTime;
    }

    public Date getReceiveMainCallRingingTime() {
        return receiveMainCallRingingTime;
    }



    public void setReceiveMainCallRingingTime(Date receiveMainCallRingingTime) {
        this.receiveMainCallRingingTime = receiveMainCallRingingTime;
    }

    public Date getReceiveMainCallAnsweredTime() {
        return receiveMainCallAnsweredTime;
    }

    public void setReceiveMainCallAnsweredTime(Date receiveMainCallAnsweredTime) {
        this.receiveMainCallAnsweredTime = receiveMainCallAnsweredTime;
    }

    public Date getReceiveMainCallFailedTime() {
        return receiveMainCallFailedTime;
    }

    public void setReceiveMainCallFailedTime(Date receiveMainCallFailedTime) {
        this.receiveMainCallFailedTime = receiveMainCallFailedTime;
    }

    public Date getReceiveTargetCallRingingTime() {
        return receiveTargetCallRingingTime;
    }

    public void setReceiveTargetCallRingingTime(Date receiveTargetCallRingingTime) {
        this.receiveTargetCallRingingTime = receiveTargetCallRingingTime;
    }

    public Date getReceiveTargetCallAnsweredTime() {
        return receiveTargetCallAnsweredTime;
    }

    public void setReceiveTargetCallAnsweredTime(Date receiveTargetCallAnsweredTime) {
        this.receiveTargetCallAnsweredTime = receiveTargetCallAnsweredTime;
    }

    public Date getReceiveTargetCallFailedTime() {
        return receiveTargetCallFailedTime;
    }

    public void setReceiveTargetCallFailedTime(Date receiveTargetCallFailedTime) {
        this.receiveTargetCallFailedTime = receiveTargetCallFailedTime;
    }

    public Date getReceiveDisconnectTime() {
        return receiveDisconnectTime;
    }

    public void setReceiveDisconnectTime(Date receiveDisconnectTime) {
        this.receiveDisconnectTime = receiveDisconnectTime;
    }

    public Integer getInterrupt() {
        return interrupt;
    }

    public void setInterrupt(Integer interrupt) {
        this.interrupt = interrupt;
    }

    public Date getInterruptTime() {
        return interruptTime;
    }

    public void setInterruptTime(Date interruptTime) {
        this.interruptTime = interruptTime;
    }

    public Boolean getIsInserted() {
        return isInserted;
    }

    public void setIsInserted(Boolean isInserted) {
        this.isInserted = isInserted;
    }


    public String getProject() {
        return project;
    }

    public void setProject(String project) {
        this.project = project;
    }


    public String getSessionId() {
        return sessionId;
    }


    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public Long getVersion() {
        return version;
    }

    public void setVersion(Long version) {
        this.version = version;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }


    public Date getModTime() {
        return modTime;
    }

    public void setModTime(Date modTime) {
        this.modTime = modTime;
    }

    public Integer getModUserId() {
        return modUserId;
    }

    public void setModUserId(Integer modUserId) {
        this.modUserId = modUserId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCallOutResultMessage() {
        return callOutResultMessage;
    }

    public void setCallOutResultMessage(String callOutResultMessage) {
        this.callOutResultMessage = callOutResultMessage;
    }

    public String getCallOutResultCode() {
        return callOutResultCode;
    }

    public void setCallOutResultCode(String callOutResultCode) {
        this.callOutResultCode = callOutResultCode;
    }

    public String getCallOutrequestId() {
        return callOutrequestId;
    }

    public void setCallOutrequestId(String callOutrequestId) {
        this.callOutrequestId = callOutrequestId;
    }


    public String getCallTaskId() {
        return callTaskId;
    }

    public void setCallTaskId(String callTaskId) {
        this.callTaskId = callTaskId;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public String getCreateUserNo() {
        return createUserNo;
    }

    public void setCreateUserNo(String createUserNo) {
        this.createUserNo = createUserNo;
    }

    public Boolean getNeedAsr() {
        return needAsr;
    }

    public void setNeedAsr(Boolean needAsr) {
        this.needAsr = needAsr;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("id:");
        sb.append(this.getId());
        sb.append("sessionId:");
        sb.append(this.getSessionId());
        sb.append("version:");
        sb.append(this.getVersion());
        sb.append("mainCallPhone:");
        sb.append(this.getMainCallPhone());
        sb.append("targetCallPhone:");
        sb.append(this.getTargetCallPhone());
        return sb.toString();
    }

}
